<?php


namespace app\admin\controller;
use think\Db;
use think\Request;
use think\Controller;
class Extrain extends ApiCommon
{
	 public function ExtrainWrite()
    {
        $newsModel=model('Extrain');
        $param=$this->param;
        $data=$newsModel->WriteExtrain($param);
        if(!$data)
        {
            return resultArray(['error'=>'添加数据失败']);
        }
        return resultArray(['data'=>'添加数据成功']);
    }

    public function ExtrainList()
    {
        $newsModel=model('Extrain');
        $param=$this->param;
        $data=$newsModel->ListExtrain($param);
        return resultArray(['data'=> $data]);
    }   
    public function ExtrainRevise()
    {
        $newsModel=model('Extrain');
        $param=$this->param;
        $data=$newsModel->ReviseExtrain($param);
        if(!$data)
        {
            return resultArray(['error'=>'修改数据失败']);
        }
        return resultArray(['data'=>'修改数据成功']);
    }
     public function ExtrainDelete()
    {
        $newsModel=model('Extrain');
        $param=$this->param;
        $data=$newsModel->DeleteExtrain($param);
        if(!$data)
        {
            return resultArray(['error'=>'删除数据失败']);
        }
        return resultArray(['data'=>'删除数据成功']);
    }   

}